<?php

class content_site_sitemaps {

    public function __construct($app) {
        $this->app = $app;
    }

    public function get_arr_maps() {
        $this->router = app::get('site')->router();
        $this->_get('article_indexs', 'site_article', 'index', 'article_id', $tmp);
        return $tmp;
    }

    private function _get($model, $ctl, $act, $index, &$tmp) {
        $offset = 0;
        $limit = 100;
        while (true) {
            $arr = $this->app->model($model)->getList('*', array(), $offset, $limit);
            foreach ((array) $arr as $row) {
                $tmp[] = array(
                    'app' => 'content',
                    'ctl' => $ctl,
                    'act' => $act,
                    'arg0' => $row[$index]
                );
            }
            $offset += $limit;
            if ($limit > count($arr))
                break;
        }
    }
}